package com.sykj.cloud.system.service.impl;

import java.util.List;
import com.sykj.cloud.common.core.utils.DateUtils;
import com.sykj.cloud.common.core.utils.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sykj.cloud.system.mapper.SysApplicationMapper;
import com.sykj.cloud.system.domain.SysApplication;
import com.sykj.cloud.system.service.ISysApplicationService;

/**
 * 系统应用定义Service业务层处理
 *
 * @author mr.will
 * @date 2021-03-15
 */
@Service
public class SysApplicationServiceImpl implements ISysApplicationService
{
    @Autowired
    private SysApplicationMapper sysApplicationMapper;

    /**
     * 新增系统应用定义
     *
     * @param sysApplication 系统应用定义
     * @return 结果
     */
    @Override
    public int insertSysApplication(SysApplication sysApplication)
    {
        sysApplication.setGuid(IdUtils.fastSimpleUUID());
        sysApplication.setCreateTime(DateUtils.getNowDate());
        return sysApplicationMapper.insertSysApplication(sysApplication);
    }

    /**
     * 修改系统应用定义
     *
     * @param sysApplication 系统应用定义
     * @return 结果
     */
    @Override
    public int updateSysApplication(SysApplication sysApplication)
    {
        sysApplication.setUpdateTime(DateUtils.getNowDate());
        return sysApplicationMapper.updateSysApplication(sysApplication);
    }

    /**
     * 批量删除系统应用定义
     *
     * @param guids 需要删除的系统应用定义ID
     * @return 结果
     */
    @Override
    public int deleteSysApplicationByIds(String[] guids)
    {
        return sysApplicationMapper.deleteSysApplicationByIds(guids);
    }

    /**
     * 删除系统应用定义信息
     *
     * @param guid 系统应用定义ID
     * @return 结果
     */
    @Override
    public int deleteSysApplicationById(String guid)
    {
        return sysApplicationMapper.deleteSysApplicationById(guid);
    }



    /**
     * 查询系统应用定义
     *
     * @param guid 系统应用定义ID
     * @return 系统应用定义
     */
    @Override
    public SysApplication getSysApplicationById(String guid)
    {
        return sysApplicationMapper.getSysApplicationById(guid);
    }

    /**
     * 查询系统应用定义列表
     *
     * @param sysApplication 系统应用定义
     * @return 系统应用定义
     */
    @Override
    public List<SysApplication> listSysApplications(SysApplication sysApplication)
    {
        return sysApplicationMapper.listSysApplications(sysApplication);
    }


}
